package com.example.cloudconsumerfeignorder80.client;

import com.example.springcloud.entity.CommonResult;
import com.example.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author chensixiang chensixiang1234@gmail.com
 */
@FeignClient(value = "CLOUD-PAYMENT-SERVICE", contextId = "payment")
public interface PaymentClient {

    @PostMapping("/payment/add")
    CommonResult<Object> add(@RequestBody Payment payment);

    @GetMapping("/payment/get/{id}")
    CommonResult<Payment> get(@PathVariable Long id);

    @GetMapping("/payment/feign/timeout")
    String timeout();
}
